package com.sn.dao;

import com.sn.model.Gift;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by qingshengzheng on 18/3/21.
 */
@Mapper
public interface GiftMapper {

    @Insert("insert into gift(name,score,createtime,comments) value(#{name},#{score},#{createtime},#{comments})")
    public void addGift(Gift gift);
    @Update("update gift set name=#{name},score=#{score},createtime=#{createtime},comments=#{comments} where id=#{id}")
    public void updateGift(Gift gift);
    @Delete("delete from gift where id=#{id}")
    public void deleteGift(Long id);
    @Select("select * from gift where 1=1")
    public List<Gift> queryGifts(Gift gift);

    @Select("select * from gift where id=#{id}")
    public Gift giftDetail(Long id);
}
